import request from '@/utils/request'

export function queryCategoryList(params) {
  return request({
    url: '/online/developer-admin/category', params,
    method: 'GET'
  })
}

export function categoryDefaultIcons() {
  return request({
    url: `/online/developer-admin/category/default/icons`,
    method: 'get'
  })
}

export function categoryInfo(categoryId) {
  return request({
    url: `/online/developer-admin/category/${categoryId}/info`,
    method: 'get'
  })
}

export const categoryAdd = data => {
  return request({
    url: '/online/developer-admin/category/save',
    method: 'POST',
    data
  })
}

export const categoryUpdate = data => {
  return request({
    url: '/online/developer-admin/category/update',
    method: 'POST',
    data
  })
}

export const categoryLock = data => {
  return request({
    url: `/online/developer-admin/category/${data}/lock`,
    method: 'POST',
    data
  })
}

export const categoryUnlock = data => {
  return request({
    url: `/online/developer-admin/category/${data}/unlock`,
    method: 'POST',
    data
  })
}

export const deleteCategory = data => {
  return request({
    url: `/online/developer-admin/category/${data}/delete`,
    method: 'POST',
    data
  })
}
